package C617;

/**
 * @description: 测试类
 * @author: luolidong
 * @create: 2021-06-17 15:51
 * @version: 1.0
 */
public class Test {
    public static void main(String[] args) {
        Student student = new Student(12,"giao",23.99);
        Student student1 = new Student(12,"giao",23.99);
        Student student2 = new Student(12,"giao",23.90);
        //输出toString
        System.out.println("student = " + student);
        System.out.println("student1 = " + student1);
        System.out.println("student2 = " + student2);
        //equals比较
        System.out.println("student.equals(student1) = " + student.equals(student1));
        System.out.println("student.equals(student2) = " + student.equals(student2));
        //hashCode比较
        System.out.println("student.hashCode() == student1.hashCode()" + (student.hashCode()==student1.hashCode()));
        System.out.println("student.hashCode() == student2.hashCode()" + (student.hashCode()==student2.hashCode()));
    }
}
